// // 深拷贝(类型考虑/Symbol/Date等的构造/循环优化/共用引用优化等),这里贴2篇文章给大家参考,https://juejin.im/post/5d6aa4f96fb9a06b112ad5b1,https://mp.weixin.qq.com/s/M7KBX3w2KqlWhZFHJSYP6Q)
function deepClone(obj) {
    let result = obj.constructor === Array ? [] : {}
    for (const key in obj) {
        if (Object.hasOwnProperty.call(obj, key)) {
            if (obj[key] && typeof obj[key] === "object") {
                result[key] = deepClone(obj[key])
            } else {
                result[key] = obj[key]
            }
        }
    }
    return result
}

function clone(obj) {
    let result = obj.constructor === Array ? [] : {}
    for (const key in object) {
        if (Object.hasOwnProperty.call(object, key)) {
            result[key] = obj[key] 
        }
    }
}


// for (const ite of [1]) {
//     console.log(ite)
// }

// let arr = [1,2,3];
let arr = [{key: 1,name: 2}];

let obj = {key: 1,name: 2}

for (const [key] of arr) {
    console.log(key)
}
// 与Objec.keys.forEach 比较像
for (const key in object) {
    if (Object.hasOwnProperty.call(object, key)) {
        const element = object[key];
        
    }
}